﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PSSsoft.Web
{
    public partial class _2_TestVerifyCode : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnTestVeriryCode_Click(object sender, EventArgs e)
        {
            #region 判断验证码
            if (Session["checkCode"] == null || string.IsNullOrEmpty(Session["checkCode"].ToString()))
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", String.Format("alert('Session保证验证码失败!')"), true);
                return;
            }
            if (string.Compare(Session["checkCode"].ToString(), txtVerifyCode.Value.Trim()) == 0)
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", String.Format("alert('验证码正确!')"), true);
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", String.Format("alert('错误!应该输入的验证码是\"{0}\" ')", Session["checkCode"].ToString()), true);
            }
            #endregion
        }

    }
}